#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author   : BUZAI
# @Time     : 2021/7/7 20:28
from selenium.webdriver.common.by import By

class TxHomeFirst():
    def __init__(self,driver):
        self.driver=driver
    def home_search(self):
        '''搜索'''
        self.driver.find_element(By.ID,'com.tencent.news:id/aqs').click()
    def home_community(self):
        '''社区'''
        self.driver.find_element(By.XPATH,'//android.widget.TextView[@text="社区"]').click()
    def home_video(self):
        '''视频'''
        self.driver.find_element(By.XPATH,'//android.widget.LinearLayout[@resource-id="com.tencent.news:id/bg0"]/android.widget.FrameLayout[2]/android.view.ViewGroup[1]/android.widget.TextView[1]').click()
    def home_top(self):
        '''第一个新闻'''
        self.driver.tap([(36,261)],50)
    def all_channels(self):
        '''全部频道'''
        self.driver.find_element(By.ID,'com.tencent.news:id/qz').click()

